from typing import List

from pydantic import BaseModel, Field


class SelectedGood(BaseModel):
    """
    商品
    """
    name: str = Field(..., description='商品名称')
    number: int = Field(..., description='商品数量')


class VipSearch(BaseModel):
    """
    搜索会员信息
    """
    vip_way: str = Field(..., description='检索方式')
    search_text: str = Field(..., description='检索文本')
    is_vip: bool = Field(..., description='是VIP？')


class PayDetail(BaseModel):
    """
    支付细节
    """
    pay_way: str = Field(..., description='支付【整单支付，分单】')
    payment_method: str = Field(..., description='支付方式【现金，刷卡】')
    person_num: int = Field(1, description='分单人数')
    money: int = Field(None, description='金额')


class CouponRelatedVo(BaseModel):
    """
    关于优惠券的相关测试参数
    """
    coupon_name: str = Field(..., description='优惠券名称')
    goods_list: List[SelectedGood] = Field(..., description='商品')
    path: str = Field(..., description='录屏位置')
    vip_search: VipSearch = Field(..., description='会员搜索信息')
    pay_detail: PayDetail = Field(..., description='支付详情')
    discount_way: str = Field(..., description='商家折扣方式')
    odoo_record: int = Field(None, description='Odoo的记录')
    language: str = Field(..., description='语言')
    applet_id: str = Field(..., description='小程序ID（方便发生异常时进行重启）')
    applet_pwd: str = Field(..., description='小程序密码（方便发生异常时进行重启）')
    clerk_id: str = Field(..., description='职员ID（方便发生异常时进行重启）')
    clerk_num: str = Field(..., description='职员密码（方便发生异常时进行重启）')
    env: str = Field(..., description='环境')
